/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tetris.view;

import javax.swing.JButton;
import java.awt.GridLayout;
import tetris.controller.MenuController;


public class MenuView extends PanelView {
    private MenuController controller;

    private JButton bResume     = new JButton("Resume");
    private JButton bOnePlayer  = new JButton("One Player");
    private JButton bTwoPlayer  = new JButton("Two Player");
    private JButton bNetwork    = new JButton("Network");
    private JButton bExit       = new JButton("Exit");
    public MenuView(MenuController cont){
        super();
        this.controller = cont;
        this.setLayout(new GridLayout(5,1));
        this.add(bOnePlayer);   this.add(bTwoPlayer);
        this.add(bNetwork);     this.add(bResume);
        this.add(bExit);
        this.setVisible(true);

        bResume.setActionCommand("Resume");
        bOnePlayer.setActionCommand("One Player");
        bTwoPlayer.setActionCommand("Two Player");
        bNetwork.setActionCommand("Network");
        bExit.setActionCommand("Exit");

        bResume.addActionListener(this.controller);
        bOnePlayer.addActionListener(this.controller);
        bTwoPlayer.addActionListener(this.controller);
        bNetwork.addActionListener(this.controller);
        bExit.addActionListener(this.controller);

        bResume.setVisible(false);
    }

    public void showResumeButton(boolean b){
        if(b){
            bResume.setVisible(true);
        }
    }
}
